<template>
  <div>
    <Breadcrumb :style="{margin: '24px 0'}">
        <BreadcrumbItem>首页</BreadcrumbItem>
        <BreadcrumbItem>商品管理</BreadcrumbItem>
        <BreadcrumbItem>{{shoptitle}}</BreadcrumbItem>
    </Breadcrumb>
    <Content :style="{padding: '24px', minHeight: '580px', background: '#fff'}">
        <div>
          <h2 class="head_style">{{shoptitle}}</h2>
        </div>
        <div>
          <p ><b>商品名称</b></p>
          <Input  placeholder="请输入商品名称" v-model="shop_name" class="input-width"></Input>
        </div><br>
        <div>
          <p ><b>商品货号</b></p>
          <Input  placeholder="请输入商品货号" v-model="shop_num" class="input-width"></Input>
        </div><br>
        <div>
          <p ><b>所属分类</b></p>
          <div>
            <Select v-model="cate_id" class="input-width" v-if="ueState" @on-change="changeCateid()">
              <Option v-for="item in categorylist_one" :value="item.id" :key="item.id" >{{item.cate_name}}</Option>
            </Select>
          </div><br>
          <div>
            <Select v-model="cate_id_two" class="input-width" v-if="ueState" @on-change="changeCateIdTwo()">
              <Option v-for="item in categorylist_two" :value="item.id" :key="item.id" >{{item.cate_name}}</Option>
            </Select>
          </div><br>
          <div>
            <Select v-model="cate_id_three" class="input-width" v-if="ueState">
              <Option v-for="(item,index) in categorylist_three" :value="item.id" :key="index" >{{item.cate_name}}</Option>
            </Select>
          </div>
        </div><br>

        <div>
          <p ><b>商品品牌</b></p>
          <Select v-model="brand_id" class="input-width" v-if="ueState">
            <Option v-for="item in brandlist" :value="item.id" :key="item.id" >{{item.brand_name}}</Option>
          </Select>
        </div><br>

        <div>
          <p ><b>商品模型</b></p>
          <Select v-model="model_id" class="input-width" v-if="ueState">
            <Option v-for="(item,index) in modellist" :value="item.id" :key="index" >{{item.name}}</Option>
          </Select>
        </div><br>

        <div>
          <p ><b>商品规格</b></p>
          <!-- <CheckboxGroup v-model="spec_array" v-for="(item,index) in speclist" :key="index" >
              <Checkbox :label="item.id">{{item.spec_name}}</Checkbox>
          </CheckboxGroup> -->
          <CheckboxGroup v-model="spec_array" >
              <Checkbox v-for="(item,index) in speclist" :key="index" :label="item.id">{{item.spec_name}}</Checkbox>
          </CheckboxGroup>
        </div><br>

        <div>
          <p ><b>基础售价</b></p>
          <Input  placeholder="请输入基础售价" v-model="low_price" class="input-width"></Input>
        </div><br>

        <div>
          <p ><b>最高售价</b></p>
          <Input  placeholder="请输入最高售价" v-model="hight_price" class="input-width"></Input>
        </div><br>

        <div>
          <p ><b>商品重量</b></p>
          <Input  placeholder="请输入商品重量" v-model="weight" class="input-width"></Input>
        </div><br>

        <div>
          <p ><b>是否包邮</b></p>
          <RadioGroup v-model="postage">
              <Radio :label = "1" >包邮</Radio>
              <Radio :label = "0" >不包邮</Radio>
          </RadioGroup>
        </div><br>

        <div>
          <p ><b>总库存</b></p>
          <Input  placeholder="请输入总库存" v-model="repertory" class="input-width"></Input>
        </div><br>

        <div>
          <p ><b>封面大图</b></p>
          <div>
            <img :src="shop_logo" id="web_favicon" class="img_style">
          </div>
          <Upload action="/admin/Article/uploadArticle" name="image" :on-success="handleSuccess" :show-upload-list="false">
              <Button  icon="ios-cloud-upload-outline" id="ghost" >文件上传</Button>
          </Upload>
        </div><br>
        <div>
          <p ><b>商品描述</b></p>
          <Input v-model="shop_introduce" type="textarea" :autosize="{minRows: 2,maxRows: 10}" placeholder="请输入产品简介" style="width:1200px"></Input>
        </div><br>
        <!-- ===================  editor组件 start  ==================== -->
        <div class="editor-container">
          <p ><b>商品详情</b></p>
          <!-- <UE :defaultMsg=defaultMsg :config=config  :id=ue1  ref="ue" v-if="ueState"></UE> -->
          <vue-ueditor-wrap :config="myConfig" v-model="defaultMsg" v-if="ueState"></vue-ueditor-wrap>
        </div><br><br>
        <!-- ===================  editor组件 end    ==================== -->

        <div>
          <Button type="primary" @click="putArticle()">提交</Button>
          <Button ><router-link to='/product'><div style="color:balck">返回</div></router-link></Button>
        </div><br><br>
    </Content>
  </div>
</template>
<style scoped>
    .info{
      border-radius: 10px;
      line-height: 20px;
      padding: 10px;
      margin: 10px;
      background-color: #ffffff;
    }
    .head_style {
      height: 50px;
    }
    p {
      line-height: 30px;
    }
    .img_style{
      height:200px;
    }
    .input-width{
      width: 700px;
    }
</style>
<script>
import productupdate from '@/assets/js/views/product/productupdate';

export default {
  ...productupdate,
};
</script>

